package com.leyou.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author xhh
 * @date 2022/3/10
 */
public class WebAppConfig implements WebMvcConfigurer {
    @Autowired
    private TokenIntercepter tokenIntercepter;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        System.err.println("先进的拦截");
        registry.addInterceptor(tokenIntercepter).addPathPatterns("/**");
    }
}
